<?php
/**
* @package 
* @subpackage 
*
* @copyright 
* @license 
*/
 
// No direct access to this file
defined('_JEXEC') or die;
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
* HTML View class for the ... Component
*
* @since 0.0.1
*/
class WelliVermittlungViewArzt extends JViewLegacy
{        /**
         * View form
         *
         * @var         form
         */
        protected $form = null;
        
        protected $item = null;
 
        /**
         * display method of Arzt view
         * @return void
         */
        public function display($tpl = null) 
        {
                // get the Data
                $form = $this->get('Form');
                $item = $this->get('Item');
                
//                $jinput = JFactory::getApplication()->input;
//                $item = $jinput->post->get('id', 0);
 
                // Check for errors.
                if (count($errors = $this->get('Errors'))) 
                {
                        JError::raiseError(500, implode('<br />', $errors));
                        return false;
                }
                // Assign the Data
                $this->form = $form;
                $this->item = $item;
 
                // Display the template
                parent::display($tpl);
 
                // Set the document
                $this->setDocument();
       }
 
        /**
         * Method to set up the document properties
         *
         * @return void
         */
        protected function setDocument() 
        {
                $isNew = ($this->item['id'] < 1);
                $document = JFactory::getDocument();
                $document->setTitle($isNew ? JText::_('COM_WELLIVERMITTLUNG_ARZT_CREATING')
                                           : JText::_('COM_WELLIVERMITTLUNG_ARZT_EDITING'));
        }
}
